package com.seeyon.apps.ext.ObxMsgPush.service;

import java.time.LocalDateTime;


public class AppTokenStorage {
	
    private String token;
    private LocalDateTime expirationTime;

    public synchronized void setToken(String token, LocalDateTime expirationTime) {
        this.token = token;
        this.expirationTime = expirationTime;
    }

    public synchronized String getToken() {
        if (expirationTime != null && expirationTime.isAfter(LocalDateTime.now())) {
            return token;
        }
        return null;
    }
}
